﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
using System.Data.SqlClient;
using System.Drawing;
using System.Net.Mail;

using System.Web.Services;

using System.IO.MemoryMappedFiles;

public partial class admin_deletepropertyrecord : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["email"] == null)
        {
            Response.Redirect("sessiont.aspx");
        }
       int s =0;
       Label1.Text = s.ToString(); 
        Label2.Text = Session["email"].ToString();

    }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }

    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        

            if (e.CommandName == "active")
            {

                //Label1.Text = "hello";
                int index = Convert.ToSByte(e.CommandArgument);

                GridViewRow row = GridView1.Rows[index];
                SqlDataAdapter adp = new SqlDataAdapter();
                SqlCommand cmd = new SqlCommand();
                DataSet ds = new DataSet();


                SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Connstr"].ConnectionString);

                //  SqlConnection con = new SqlConnection("Data Source=MRINAL-PC;Initial Catalog=onlinejobportal;User Id=sa;Password=mrinal");
                con.Open();

                SqlCommand objectvalue = new SqlCommand("", con);
                cmd.Connection = con;


                SqlCommand cmd1 = new SqlCommand("update property_rent  set status1=1 where p_id='" + row.Cells[5].Text + "'", con);
                cmd1.ExecuteNonQuery();

                //Response.Write(@"<script language='javascript'>alert('property  is inactive now')</script>");
                Response.Redirect("property_delete_conf.aspx");

                // con.Close();

                con.Close();
           
        }
    }
    protected void LinkButton1_Click(object sender, System.EventArgs e)
    {
        Session.Abandon();
        Response.Redirect("../admin.aspx");
    }
    protected void DropDownList9_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {

    }
}